<template>
  <div class="container">
    <uv-cell-group :border="false">
      <uv-cell isLink title="手机号绑定" :value="counter.slParams.mobile" :border="false" @click="changePhone"></uv-cell>
    </uv-cell-group>
    <view class="fz12 desc">第三方账号绑定</view>
    <uv-cell-group :border="false">
      <uv-cell isLink title="微信" value="11111" :border="false"></uv-cell>
    </uv-cell-group>
  </div>
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance();
import useCounterStore from "@/stores/counter";
const counter = useCounterStore();

onMounted(() => {
  getUserMobile();
});

async function changePhone() {
  let resp = await proxy.$utils.showModal({
    title: "更换已绑定的手机号",
    content: `当前绑定的手机是 ${counter.slParams.mobile}`,
    cancelColor: "#AFAFAF",
    confirmColor: "#AF37F5",
    cancelText: "取消",
    confirmText: "更换",
  });
  if (!resp) return;
  proxy.$utils.toLink(`/packagePages/my/changePhone`);
}

async function getUserMobile() {
  let { mobile } = await proxy.$apis.getUserMobile();
  counter.setRelease("mobile", mobile);
  console.log("手机号", mobile);
}
</script>



<style lang="scss" scoped>
.container {
  min-height: 100vh;
  background-color: #fafafa;
  .uv-cell-group {
    background-color: white;
  }
  .desc {
    color: #999999;
    padding: 15px;
  }
}
</style>





